-
Notifications
You must be signed in to change notification settings - Fork 27
teams: smoother user repository task realm handling (fixes #9032) #9010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Injected `UserRepository` into `AdapterTask` to handle user data fetching. - Removed direct `Realm` instance calls from `showAssignee` to prevent per-item database queries. - Updated `TeamTaskFragment` to provide the `UserRepository` to the adapter. This change improves RecyclerView performance by centralizing data access and reducing synchronous I/O on the main thread.
- Injected `UserRepository` into `AdapterTask` to handle user data fetching. - Removed direct `Realm` instance calls from `showAssignee` to prevent per-item database queries. - Updated `TeamTaskFragment` to use the inherited `userRepository` and pass it to the adapter. - Fixed a compilation error caused by a duplicate `UserRepository` injection. This change improves RecyclerView performance by centralizing data access and reducing synchronous I/O on the main thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| private fun updatedTeamTaskList(updatedList: RealmResults<RealmTeamTask>) { | ||
| viewLifecycleOwner.lifecycleScope.launch { | ||
| adapterTask = AdapterTask(requireContext(), updatedList, !isMemberFlow.value, viewLifecycleOwner.lifecycleScope) | ||
| adapterTask = AdapterTask(requireContext(), updatedList, !isMemberFlow.value, viewLifecycleOwner.lifecycleScope, userRepository) | ||
| adapterTask.setListener(this@TeamTaskFragment) | ||
| binding.rvTask.adapter = adapterTask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inject UserRepository into TeamTaskFragment
The new adapter constructor requires a UserRepository, and TeamTaskFragment now passes userRepository when creating AdapterTask. However, this fragment does not declare or inject a UserRepository field anywhere, so the references at the adapter instantiations fail to compile with Unresolved reference: userRepository. Add an @Inject lateinit var userRepository: UserRepository (or equivalent constructor injection) before using it; otherwise the module cannot build.
Useful? React with 👍 / 👎.
UserRepositoryintoAdapterTaskto handle user data fetching.Realminstance calls fromshowAssigneeto prevent per-item database queries.TeamTaskFragmentto provide theUserRepositoryto the adapter.This change improves RecyclerView performance by centralizing data access and reducing synchronous I/O on the main thread.
https://jules.google.com/session/18431213191892173805